home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Produtividade / OpenOffice.org 2.0.1 / openofficeorg4.cab / idle.py < prev    next >
Text File  |  2005-11-19  |  683b  |  24 lines

  1. #!/usr/bin/python
  2.  
  3. try:
  4.     import idlelib.PyShell
  5. except ImportError:
  6.     # IDLE is not installed, but maybe PyShell is on sys.path:
  7.     try:
  8.         import PyShell
  9.     except ImportError:
  10.         raise
  11.     else:
  12.         import os
  13.         idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
  14.         if idledir != os.getcwd():
  15.             # We're not in the IDLE directory, help the subprocess find run.py
  16.             pypath = os.environ.get('PYTHONPATH', '')
  17.             if pypath:
  18.                 os.environ['PYTHONPATH'] = pypath + ':' + idledir
  19.             else:
  20.                 os.environ['PYTHONPATH'] = idledir
  21.         PyShell.main()
  22. else:
  23.     idlelib.PyShell.main()
  24.